/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author bluepc
 */
@Embeddable
public class OrderDetailsPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_order")
    private int idOrder;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_dish")
    private int idDish;

    public OrderDetailsPK() {
    }

    public OrderDetailsPK(int idOrder, int idDish) {
        this.idOrder = idOrder;
        this.idDish = idDish;
    }

    public int getIdOrder() {
        return idOrder;
    }

    public void setIdOrder(int idOrder) {
        this.idOrder = idOrder;
    }

    public int getIdDish() {
        return idDish;
    }

    public void setIdDish(int idDish) {
        this.idDish = idDish;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idOrder;
        hash += (int) idDish;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderDetailsPK)) {
            return false;
        }
        OrderDetailsPK other = (OrderDetailsPK) object;
        if (this.idOrder != other.idOrder) {
            return false;
        }
        if (this.idDish != other.idDish) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.OrderDetailsPK[ idOrder=" + idOrder + ", idDish=" + idDish + " ]";
    }
    
}
